<div class="box-body">
    <form class="layui-form" action="{:url('/wms/category/save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">父分类</label>
            <div class="layui-input-block">
                <select name="parent_id" lay-search>
                    <option value="0">顶级分类</option>
                    {foreach $category as $c}
                    <option {if isset($cate) && $cate.parent_id==$c.cate_id}selected{/if} value="{$c.cate_id}">{php}echo str_repeat("├─",$c['level']);{/php}{$c.name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">名称</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" name="name" {if isset($cate)}value="{$cate.name}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" value="1" {if !isset($cate) || (isset($cate) && $cate.status=='1')}checked{/if} lay-skin="switch">
            </div>
        </div>
        {if isset($cate)}
        <input type="hidden" name="cate_id" value="{$cate.cate_id}">
        {/if}
    </form>
</div>